<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 7.3.0">

  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.ico">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.ico">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha256-wiz7ZSCn/btzhjKDQBms9Hx4sSeUYsDrTLg7roPstac=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.28/fancybox/fancybox.css" integrity="sha256-6cQIC71/iBIYXFK+0RHAvwmjwWzkWd+r7v/BX3/vZDc=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/themes/green/pace-theme-minimal.css">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/pace.min.js" integrity="sha256-gqd7YTjg/BtfqWSwsJOvndl0Bxc8gFImLEkXQT8+qj0=" crossorigin="anonymous"></script>

<script class="next-config" data-name="main" type="application/json">{"hostname":"sumumm.github.io","root":"/","images":"/images","scheme":"Gemini","darkmode":false,"version":"8.19.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":true,"style":"mac"},"fold":{"enable":true,"height":300},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":true,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":true,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>

    <meta name="description" content="本文主要是uboot——命令的基本使用的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。">
<meta property="og:type" content="article">
<meta property="og:title" content="LV09-02-uboot-02-命令简介">
<meta property="og:url" content="https://sumumm.github.io/post/41a25a19.html">
<meta property="og:site_name" content="苏木">
<meta property="og:description" content="本文主要是uboot——命令的基本使用的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2023-07-07T11:34:09.000Z">
<meta property="article:modified_time" content="2025-06-13T16:25:57.001Z">
<meta property="article:author" content="苏木">
<meta property="article:tag" content="LV09-uboot与linux">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="https://sumumm.github.io/post/41a25a19.html">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"https://sumumm.github.io/post/41a25a19.html","path":"post/41a25a19.html","title":"LV09-02-uboot-02-命令简介"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>LV09-02-uboot-02-命令简介 | 苏木</title>
  








    <script src="/js/browser_tools_disable.js"></script>

  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
<!-- hexo injector head_end start --><link rel="stylesheet" href="https://unpkg.com/hexo-next-tags-plus@latest/lib/tag_plus.css" media="defer" onload="this.media='all'"><!-- hexo injector head_end end --></head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">苏木</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">我的学习之路</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>苏木的家</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类页<span class="badge">42</span></a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档页<span class="badge">673</span></a></li><li class="menu-item menu-item-flink"><a href="/flink/" rel="section"><i class="fa fa-link fa-fw"></i>友人帐</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于我</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%80%E3%80%81%E5%87%A0%E4%B8%AA%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4"><span class="nav-text">一、几个常用命令</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-help"><span class="nav-text">1. help</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-reset"><span class="nav-text">2. reset</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-loadb"><span class="nav-text">3. loadb</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-go"><span class="nav-text">4. go</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5-run"><span class="nav-text">5. run</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#6-mtest"><span class="nav-text">6. mtest</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%BA%8C%E3%80%81%E4%BF%A1%E6%81%AF%E6%9F%A5%E8%AF%A2"><span class="nav-text">二、信息查询</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-printenv"><span class="nav-text">1. printenv</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-bdinfo"><span class="nav-text">2. bdinfo</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-version"><span class="nav-text">3. version</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%89%E3%80%81%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F"><span class="nav-text">三、环境变量</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-setenv"><span class="nav-text">1. setenv</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-1-%E4%BF%AE%E6%94%B9%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F"><span class="nav-text">1.1 修改环境变量</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-2-%E5%88%9B%E5%BB%BA%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F"><span class="nav-text">1.2 创建环境变量</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-3-%E5%88%A0%E9%99%A4%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F"><span class="nav-text">1.3 删除环境变量</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-saveenv"><span class="nav-text">2. saveenv</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%9B%9B%E3%80%81%E5%86%85%E5%AD%98%E6%93%8D%E4%BD%9C"><span class="nav-text">四、内存操作</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-md"><span class="nav-text">1. md</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-nm"><span class="nav-text">2. nm</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-mm"><span class="nav-text">3. mm</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-mw"><span class="nav-text">4. mw</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5-cp"><span class="nav-text">5. cp</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#6-cmp"><span class="nav-text">6. cmp</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%BA%94%E3%80%81%E5%AD%98%E5%82%A8%E5%99%A8%E8%AE%BF%E9%97%AE"><span class="nav-text">五、存储器访问</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-mmcinfo"><span class="nav-text">1. mmcinfo</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-mmc-rescan"><span class="nav-text">2. mmc rescan</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-mmc-list"><span class="nav-text">3. mmc list</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-mmc-dev"><span class="nav-text">4. mmc dev</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5-mmc-part"><span class="nav-text">5. mmc part</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#6-mmc-read"><span class="nav-text">6. mmc read</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#7-mmc-write"><span class="nav-text">7. mmc write</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#8-mmc-erase"><span class="nav-text">8. mmc erase</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%85%AD%E3%80%81%E7%BD%91%E7%BB%9C%E6%93%8D%E4%BD%9C"><span class="nav-text">六、网络操作</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-%E7%BD%91%E7%BB%9C%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F"><span class="nav-text">1. 网络环境变量</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-ping"><span class="nav-text">2. ping</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-dhcp"><span class="nav-text">3. dhcp</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-tftp"><span class="nav-text">4. tftp</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%83%E3%80%81%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%E6%93%8D%E4%BD%9C"><span class="nav-text">七、文件系统操作</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-FAT%E6%A0%BC%E5%BC%8F%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F"><span class="nav-text">1. FAT格式文件系统</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-1-fatinfo"><span class="nav-text">1.1 fatinfo</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-2-fatls"><span class="nav-text">1.2 fatls</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-3-fatload"><span class="nav-text">1.3 fatload</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-EXT%E6%A0%BC%E5%BC%8F%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F"><span class="nav-text">2. EXT格式文件系统</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%85%AB%E3%80%81boot%E6%93%8D%E4%BD%9C"><span class="nav-text">八、boot操作</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-%E4%B8%A4%E4%B8%AA%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F"><span class="nav-text">1. 两个环境变量</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-1-boodcmd"><span class="nav-text">1.1 boodcmd</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-2-bootargs"><span class="nav-text">1.2 bootargs</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-bootm"><span class="nav-text">2. bootm</span></a></li></ol></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="苏木"
      src="/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">苏木</p>
  <div class="site-description" itemprop="description">莫道桑榆晚，为霞尚满天</div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">673</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">42</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
        <span class="site-state-item-count">43</span>
        <span class="site-state-item-name">标签</span>
      </div>
  </nav>
</div>
  <div class="links-of-author animated">
      <span class="links-of-author-item">
        <a href="https://github.com/sumumm" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;sumumm" rel="noopener me" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
  </div>

        </div>
      </div>
    </div>

    
  </aside>


    </div>

    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://sumumm.github.io/post/41a25a19.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.jpg">
      <meta itemprop="name" content="苏木">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="苏木">
      <meta itemprop="description" content="莫道桑榆晚，为霞尚满天">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="LV09-02-uboot-02-命令简介 | 苏木">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          LV09-02-uboot-02-命令简介
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2023-07-07 19:34:09" itemprop="dateCreated datePublished" datetime="2023-07-07T19:34:09+08:00">2023-07-07</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/" itemprop="url" rel="index"><span itemprop="name">嵌入式开发</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/" itemprop="url" rel="index"><span itemprop="name">01HQ课程体系</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV09-uboot%E4%B8%8Elinux/" itemprop="url" rel="index"><span itemprop="name">LV09-uboot与linux</span></a>
        </span>
    </span>

  
    <span class="post-meta-break"></span>
    <span class="post-meta-item" title="本文字数">
      <span class="post-meta-item-icon">
        <i class="far fa-file-word"></i>
      </span>
      <span class="post-meta-item-text">本文字数：</span>
      <span>7.1k</span>
    </span>
    <span class="post-meta-item" title="阅读时长">
      <span class="post-meta-item-icon">
        <i class="far fa-clock"></i>
      </span>
      <span class="post-meta-item-text">阅读时长 &asymp;</span>
      <span>26 分钟</span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody"><p>本文主要是uboot——命令的基本使用的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。</p>
<span id="more"></span>

<!-- Photo: https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV09-uboot%E4%B8%8Elinux/LV09-02-uboot-02-%E5%91%BD%E4%BB%A4%E7%AE%80%E4%BB%8B/img/ -->

<details class="folding-tag" blue><summary> 点击查看使用工具及版本 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center" width=150px>Windows</td>        <td align="left">windows11</td>    </tr>    <tr>        <td align="center">Ubuntu</td>        <td align="left">Ubuntu16.04的64位版本</td>      </tr>    <tr>        <td align="center">VMware® Workstation 16 Pro</td>        <td align="left">16.2.3 build-19376536</td>      </tr>    <tr>        <td align="center">SecureCRT</td>        <td align="left">Version 8.7.2 (x64 build 2214)   -   正式版-2020年5月14日</td>      </tr>    <tr>        <td align="center" width=150>Linux开发板</td>        <td align="left">华清远见 底板: FS4412_DEV_V5 核心板: FS4412 V2</td>      </tr>    <tr>        <td align="center" width=150>u-boot</td>        <td align="left">2013.01</td>      </tr></table>
              </div>
            </details>

<details class="folding-tag" blue><summary> 点击查看本文参考资料 </summary>
              <div class='content'>
              <table>    <tr><td align="center">参考方向  </td><td align="center">参考原文</td></tr>    <tr><td align="left">---</td><td align="left"><a href="" target="_blank">--- <i class="fa fa-external-link-alt"></i> </a></td></tr></table>
              </div>
            </details>

<details class="folding-tag" blue><summary> 点击查看相关文件下载 </summary>
              <div class='content'>
              <table>    <tr><td align="center">文件</td><td align="center">下载链接</td></tr>    <tr><td align="left">uboot_bin.rar</td><td align="left"><a href="https://wwz.lanzouy.com/iH1vO09jxavi" target="_blank">uboot原始镜像(不可以直接烧写)和LED灯闪烁测试程序 <i class="fa fa-external-link-alt"></i> </a></td></tr>    <tr><td align="left">WIn32_disk_imager.rar</td><td align="left"><a href="https://wwz.lanzouy.com/iX1wL09jx6zi" target="_blank">windows下向SD卡烧写uboot镜像的软件 <i class="fa fa-external-link-alt"></i> </a></td></tr>    <tr><td align="left">example_uboot.rar</td><td align="left"><a href="https://wwz.lanzouy.com/i6TTb09jx6tc" target="_blank">可以直接烧写到SD卡的uboot镜像文件 <i class="fa fa-external-link-alt"></i> </a></td></tr></table>
              </div>
            </details>

<h1 id="一、几个常用命令"><a href="#一、几个常用命令" class="headerlink" title="一、几个常用命令"></a><font size=3>一、几个常用命令</font></h1><h2 id="1-help"><a href="#1-help" class="headerlink" title="1. help"></a><font size=3>1. <code>help</code></font></h2><p>我们在<code>SecureCRT</code>终端输入<code>help</code>，便会打印出当前<code>uboot</code>所支持的所有命令。</p>
<details class="folding-tag" blue><summary> 点击查看相关命令 </summary>
              <div class='content'>
              <figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br></pre></td><td class="code"><pre><span class="line">?       - alias for &#x27;help&#x27;</span><br><span class="line">base    - print or set address offset</span><br><span class="line">bdinfo  - print Board Info structure</span><br><span class="line">boot    - boot default, i.e., run &#x27;bootcmd&#x27;</span><br><span class="line">bootd   - boot default, i.e., run &#x27;bootcmd&#x27;</span><br><span class="line">bootelf - Boot from an ELF image in memory</span><br><span class="line">bootm   - boot application image from memory</span><br><span class="line">bootp   - boot image via network using BOOTP/TFTP protocol</span><br><span class="line">bootvx  - Boot vxWorks from an ELF image</span><br><span class="line">cmp     - memory compare</span><br><span class="line">coninfo - print console devices and information</span><br><span class="line">cp      - memory copy</span><br><span class="line">crc32   - checksum calculation</span><br><span class="line">dhcp    - boot image via network using DHCP/TFTP protocol</span><br><span class="line">echo    - echo args to console</span><br><span class="line">editenv - edit environment variable</span><br><span class="line">emmc    - Open/Close eMMC boot Partition</span><br><span class="line">env     - environment handling commands</span><br><span class="line">erase   - erase FLASH memory</span><br><span class="line">exit    - exit script</span><br><span class="line">false   - do nothing, unsuccessfully</span><br><span class="line">fatinfo - print information about filesystem</span><br><span class="line">fatload - load binary file from a dos filesystem</span><br><span class="line">fatls   - list files in a directory (default /)</span><br><span class="line">fdisk   - fdisk - fdisk for sd/mmc.</span><br><span class="line"></span><br><span class="line">fdt     - flattened device tree utility commands</span><br><span class="line">flinfo  - print FLASH memory information</span><br><span class="line">go      - start application at address &#x27;addr&#x27;</span><br><span class="line">help    - print command description/usage</span><br><span class="line">iminfo  - print header information for application image</span><br><span class="line">imxtract- extract a part of a multi-image</span><br><span class="line">itest   - return true/false on integer compare</span><br><span class="line">loadb   - load binary file over serial line (kermit mode)</span><br><span class="line">loads   - load S-Record file over serial line</span><br><span class="line">loady   - load binary file over serial line (ymodem mode)</span><br><span class="line">loop    - infinite loop on address range</span><br><span class="line">md      - memory display</span><br><span class="line">mm      - memory modify (auto-incrementing address)</span><br><span class="line">mmc     - MMC sub system</span><br><span class="line">mmcinfo - display MMC info</span><br><span class="line">movi    - movi  - sd/mmc r/w sub system for SMDK board</span><br><span class="line"></span><br><span class="line">mtest   - simple RAM read/write test</span><br><span class="line">mw      - memory write (fill)</span><br><span class="line">nm      - memory modify (constant address)</span><br><span class="line">ping    - send ICMP ECHO_REQUEST to network host</span><br><span class="line">printenv- print environment variables</span><br><span class="line">protect - enable or disable FLASH write protection</span><br><span class="line">reset   - Perform RESET of the CPU</span><br><span class="line">run     - run commands in an environment variable</span><br><span class="line">saveenv - save environment variables to persistent storage</span><br><span class="line">setenv  - set environment variables</span><br><span class="line">showvar - print local hushshell variables</span><br><span class="line">sleep   - delay execution for some time</span><br><span class="line">source  - run script from memory</span><br><span class="line">test    - minimal test like /bin/sh</span><br><span class="line">tftpboot- boot image via network using TFTP protocol</span><br><span class="line">true    - do nothing, successfully</span><br><span class="line">version - print monitor, compiler and linker version</span><br></pre></td></tr></table></figure>
              </div>
            </details>

<h2 id="2-reset"><a href="#2-reset" class="headerlink" title="2. reset"></a><font size=3>2. <code>reset</code></font></h2><p><code>reset</code>命令可以用于重启开发板，我们直接在命令行输入<code>reset</code>即可：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # reset   </span><br><span class="line">resetting ...</span><br></pre></td></tr></table></figure>

<h2 id="3-loadb"><a href="#3-loadb" class="headerlink" title="3. loadb"></a><font size=3>3. <code>loadb</code></font></h2><p><code>loadb</code>命令通过串口进行数据的传输，我们一般使用该命令进行二进制文件的传输，它使用的是<code>kermit protocol</code>传输协议，一般使用格式如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">loadb [ off ] [ baud ]</span><br></pre></td></tr></table></figure>

<ul>
<li><code>off</code>：其实就是数据要加载到内存中的起始地址，例如在<code>fs4412</code>开发板中，我们经常使用<code>loadb 40008000</code>来启动<code>kermit</code>的传输。</li>
<li><code>baud</code>：传输的波特率，可以不写，默认为<code>115200</code>。</li>
</ul>
<p>例如，</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # loadb 40008000</span><br></pre></td></tr></table></figure>

<p>然后按下<code>enter</code>按键便会等待数据的传输，我们可以直接将文件拖拽到<code>SecureCRT</code>终端界面中，然后选择发送<code>Kermmit</code>即可开启文件传输，将会有以下提示：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment"># Ready for binary (kermit) download to 0x40008000 at 115200 bps...</span></span></span><br><span class="line"></span><br><span class="line">  kermit  trl+C ȡ</span><br><span class="line">正在传输 interface.bin...</span><br><span class="line"><span class="meta prompt_">  100% </span><span class="language-bash">    104   104 /0:00:01       0</span>   </span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment"># Total Size      = 0x00000068 = 104 Bytes</span></span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment"># Start Addr      = 0x40008000</span></span></span><br></pre></td></tr></table></figure>

<h2 id="4-go"><a href="#4-go" class="headerlink" title="4. go"></a><font size=3>4. <code>go</code></font></h2><p><code>go</code>命令用于跳到指定的地址处执行应用，命令格式如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">go addr [arg ...]</span><br></pre></td></tr></table></figure>

<ul>
<li><code>addr</code>：是应用在<code>DRAM</code>中的首地址</li>
</ul>
<p>我们上一步使用<code>loadb</code>命令将<code>interface.bin</code>文件下载到了<code>0X40008000</code>，现在我们使用<code>go</code>命令启动<code>interface.bin</code>这个应用，命令如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # go 40008000</span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment"># Starting application at 0x40008000 ...</span></span></span><br></pre></td></tr></table></figure>

<h2 id="5-run"><a href="#5-run" class="headerlink" title="5. run"></a><font size=3>5. <code>run</code></font></h2><p><code>run</code>命令用于运行环境变量中定义的命令，比如可以通过<code>run bootcmd</code>来运行 <code>bootcmd</code>中的启动命令，但是<code>run</code>命令最大的作用在于运行我们自定义的环境变量。在后面调试<code>Linux</code>系统的时候可能常常要在网络启动和<code>EMMC/NAND</code>启动之间来回切换，而<code>bootcmd</code>只能保存一种启动方式，如果要换另外一种启动方式的话就得重写<code>bootcmd</code>，会很麻烦。这里我们就可以通过自定义环境变量来实现不同的启动方式，比如定义环境变量<code>mybootemmc</code>表示从<code>emmc</code>启动，定义<code>mybootnet</code>表示从网络启动，定义<code>mybootnand</code>表示从<code>NAND</code>启动。如果要切换启动方式的话只需要运行<code>run mybootxxx</code>(<code>xxx</code>为 <code>emmc</code>、 <code>net</code>或 <code>nand</code>)即可。一般命令格式如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">run var [...]</span><br></pre></td></tr></table></figure>

<ul>
<li><code>var</code>：表示需要运行的定义了命令的环境变量名。</li>
</ul>
<h2 id="6-mtest"><a href="#6-mtest" class="headerlink" title="6. mtest"></a><font size=3>6. <code>mtest</code></font></h2><p><code>mtest</code>命令是一个简单的内存读写测试命令，可以用来测试自己开发板上的<code>DDR</code>，一般命令格式如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mtest [start [end [pattern [iterations]]]]</span><br></pre></td></tr></table></figure>

<ul>
<li><code>start</code>：要测试的<code>DRAM</code>开始地址。</li>
<li><code> end</code>：是结束地址。</li>
</ul>
<p>【注意】如果要结束测试就按下键盘上的<code>Ctrl + C</code>键。</p>
<h1 id="二、信息查询"><a href="#二、信息查询" class="headerlink" title="二、信息查询"></a><font size=3>二、信息查询</font></h1><h2 id="1-printenv"><a href="#1-printenv" class="headerlink" title="1. printenv"></a><font size=3>1. <code>printenv</code></font></h2><p>该命令主要用于打印出所有的环境变量信息，我们在<code>SecureCRT</code>终端中直接执行下边的命令，便可以得到该命令的使用格式：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # ? printenv</span><br><span class="line">printenv - print environment variables</span><br><span class="line"></span><br><span class="line">Usage:</span><br><span class="line">printenv [-a]</span><br><span class="line">    - print [all] values of all environment variables</span><br><span class="line">printenv name ...</span><br><span class="line">    - print value of environment variable &#x27;name</span><br></pre></td></tr></table></figure>

<p>该命令使用方式很简单，我们直接在命令行输入：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # printenv</span><br></pre></td></tr></table></figure>

<p>然后我们会得到以下信息：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">baudrate=115200</span><br><span class="line">baudrate=115200</span><br><span class="line">bootargs=root=/dev/nfs nfsroot=192.168.10.101:/home/hk/4nfs rw console=ttySAC2,115200 init=/linuxrc ip=192.168.10.102</span><br><span class="line">bootcmd=tftp 0x41000000 /fs4412/uImage;tftp 0x42000000 /fs4412/exynos4412-fs4412.dtb;bootm 0x41000000 - 0x42000000</span><br><span class="line">bootdelay=3</span><br><span class="line">ethact=dm9000</span><br><span class="line">ethaddr=11:22:33:44:55:66</span><br><span class="line">fileaddr=41000000</span><br><span class="line">filesize=26D213</span><br><span class="line">gatewayip=192.168.10.1</span><br><span class="line">ipaddr=192.168.10.102</span><br><span class="line">netmask=255.255.252.0</span><br><span class="line">serverip=192.168.10.101</span><br><span class="line">stderr=serial</span><br><span class="line">stdin=serial</span><br><span class="line">stdout=serial</span><br><span class="line"></span><br><span class="line">Environment size: 498/16380 bytes</span><br></pre></td></tr></table></figure>

<h2 id="2-bdinfo"><a href="#2-bdinfo" class="headerlink" title="2. bdinfo"></a><font size=3>2. <code>bdinfo</code></font></h2><p><code>bdinfo</code>命令，此命令用于查看板子信息，直接输入<code>bdinfo</code>即可，结果如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # bdinfo</span><br><span class="line">arch_number = 0x00000D7F</span><br><span class="line">boot_params = 0x40000100</span><br><span class="line">DRAM bank   = 0x00000000</span><br><span class="line"><span class="meta prompt_">-&gt; </span><span class="language-bash">start    = 0x40000000</span></span><br><span class="line"><span class="meta prompt_">-&gt; </span><span class="language-bash">size     = 0x10000000</span></span><br><span class="line">DRAM bank   = 0x00000001</span><br><span class="line"><span class="meta prompt_">-&gt; </span><span class="language-bash">start    = 0x50000000</span></span><br><span class="line"><span class="meta prompt_">-&gt; </span><span class="language-bash">size     = 0x10000000</span></span><br><span class="line">DRAM bank   = 0x00000002</span><br><span class="line"><span class="meta prompt_">-&gt; </span><span class="language-bash">start    = 0x60000000</span></span><br><span class="line"><span class="meta prompt_">-&gt; </span><span class="language-bash">size     = 0x10000000</span></span><br><span class="line">DRAM bank   = 0x00000003</span><br><span class="line"><span class="meta prompt_">-&gt; </span><span class="language-bash">start    = 0x70000000</span></span><br><span class="line"><span class="meta prompt_">-&gt; </span><span class="language-bash">size     = 0x10000000</span></span><br><span class="line">ethaddr     = 11:22:33:44:55:66</span><br><span class="line">ip_addr     = 192.168.10.102</span><br><span class="line">baudrate    = 115200 bps</span><br><span class="line">TLB addr    = 0x7FFF0000</span><br><span class="line">relocaddr   = 0x7FE8A000</span><br><span class="line">reloc off   = 0x3C08A000</span><br><span class="line">irq_sp      = 0x7FD81F48</span><br><span class="line">sp start    = 0x7FD81F38</span><br><span class="line">FB base     = 0x00000000</span><br></pre></td></tr></table></figure>

<h2 id="3-version"><a href="#3-version" class="headerlink" title="3. version"></a><font size=3>3. <code>version</code></font></h2><p><code>version</code>用于查看 <code>uboot</code>的版本号，直接输入<code>version</code>即可：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # version</span><br><span class="line"></span><br><span class="line">U-Boot 2013.01 (Apr 11 2020 - 04:15:49) for fs4412</span><br><span class="line">arm-none-linux-gnueabi-gcc (crosstool-NG hg+default-2685dfa9de14 - tc0002) 4.6.4</span><br><span class="line">GNU ld (crosstool-NG hg+default-2685dfa9de14 - tc0002) 2.23.1</span><br></pre></td></tr></table></figure>

<h1 id="三、环境变量"><a href="#三、环境变量" class="headerlink" title="三、环境变量"></a><font size=3>三、环境变量</font></h1><p>上边我们通过<code>printenv</code>打印出来的信息中有很多的环境变量，比如 <code>baudrate</code>、 <code>bootcmd</code>等等。<code>uboot</code>中的环境变量都是字符串，既然叫做环境变量，那么它的作用就和变量一样。比如<code>bootdelay</code>这个环境变量就表示 <code>uboot </code>启动延时时间，默认 <code>bootdelay=3</code>，也就默认延时 <code>3 </code>秒。前面说的 <code>3</code> 秒倒计时就是由 <code>bootdelay</code> 定 义的，如果将 <code>bootdelay </code>改为<code>5</code>的话就会倒计时 <code>5s</code>了。 。</p>
<h2 id="1-setenv"><a href="#1-setenv" class="headerlink" title="1. setenv"></a><font size=3>1. <code>setenv</code></font></h2><p>该命令主要用于操作环境变量，我们在<code>SecureCRT</code>中查看一下该命令使用格式：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # ? setenv</span><br><span class="line">setenv - set environment variables</span><br><span class="line"></span><br><span class="line">Usage:</span><br><span class="line">setenv [-f] name value ...</span><br><span class="line">    - [forcibly] set environment variable &#x27;name&#x27; to &#x27;value ...&#x27;</span><br><span class="line">setenv [-f] name</span><br><span class="line">    - [forcibly] delete environment variable &#x27;name&#x27;</span><br></pre></td></tr></table></figure>

<p>【注意】此命令修改完后，开发板若重启，那么所有环境变量将会复原。</p>
<h3 id="1-1-修改环境变量"><a href="#1-1-修改环境变量" class="headerlink" title="1.1 修改环境变量"></a><font size=3>1.1 修改环境变量</font></h3><p>环境变量是可以修改的，例如我们想修改一下<code>uboot</code>启动<code>linux</code>倒计时，这个时间是由<code>bootdelay</code>环境变量来控制的，我们上边是<code>5</code>秒，我们可以通过以下命令更改秒数，例如，</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # setenv bootdelay 3</span><br></pre></td></tr></table></figure>

<p>这样便可以将<code>bootdelay</code>修改为<code>3</code>秒。</p>
<h3 id="1-2-创建环境变量"><a href="#1-2-创建环境变量" class="headerlink" title="1.2 创建环境变量"></a><font size=3>1.2 创建环境变量</font></h3><p>我们也可以通过该命令创建新的环境变量：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # setenv name value</span><br></pre></td></tr></table></figure>

<p>例如，</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # setenv aaa ccc</span><br><span class="line">fs4412 # print aaa</span><br><span class="line">aaa=ccc</span><br></pre></td></tr></table></figure>

<h3 id="1-3-删除环境变量"><a href="#1-3-删除环境变量" class="headerlink" title="1.3 删除环境变量"></a><font size=3>1.3 删除环境变量</font></h3><p>我们创建了不想要的环境变量怎么办呢？有创建肯定有删除，该命令同样也可以删除环境变量，去掉后边的值，就可以将一个已经存在的环境变量删除：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # setenv name</span><br></pre></td></tr></table></figure>

<p>例如，</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # setenv aaa    </span><br><span class="line">fs4412 # print aaa </span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment"># Error: &quot;aaa&quot; not defined</span></span></span><br></pre></td></tr></table></figure>

<p>删除后，我们打印一个不存在测环境变量便会出错。</p>
<h2 id="2-saveenv"><a href="#2-saveenv" class="headerlink" title="2. saveenv"></a><font size=3>2. <code>saveenv</code></font></h2><p>前边的环境变量我们修改后，只在此次使用有效，当开发板关机时，修改过的环境变量全部会失效，那如何保存下来，让这些修改过的环境变量后边也依然可以生效呢？我们可以使用<code>saveenv</code>命令。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # saveenv</span><br><span class="line">Saving Environment to MMC...</span><br><span class="line">Writing to MMC(0)... .done</span><br></pre></td></tr></table></figure>

<p>这样我们修改过的环境变量就会被保存到<code>eMMC</code>，下一次开发板重新启动，环境变量还会是我们修改后的值。</p>
<h1 id="四、内存操作"><a href="#四、内存操作" class="headerlink" title="四、内存操作"></a><font size=3>四、内存操作</font></h1><h2 id="1-md"><a href="#1-md" class="headerlink" title="1. md"></a><font size=3>1. <code>md</code></font></h2><p><code>md</code>命令用于显示内存值，格式如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">md[.b, .w, .l] address [# of objects]</span><br></pre></td></tr></table></figure>

<ul>
<li><code> [.b .w .l]</code>：对应 <code>byte</code>、<code>word</code>和 <code>long</code>，也就是分别以 <code>1</code>个字节 、 <code>2</code>个字节、 <code>4</code>个字节。</li>
<li><code>address</code>：要查看的内存起始地址。</li>
<li><code>[# of objects]</code>：表示要查看的数据长度，这个数据长度单位不是字节，而是跟我们所选择的显示格式有关。比如我们设置要查看的内存长度 为<code>20</code>(十六进制为 <code>0x14</code>)，如果显示格式为 <code>.b</code> 的话那就表示<code>20</code>个字节；如果显示格式为<code>.w</code>的话就表示 <code>20</code>个 <code>word</code>，也就是 <code>20*2=40</code>个字节；如果显示格式为 <code>.l</code>的话就表示 <code>20</code>个 <code>long</code>，也就是<code>20*4=80</code>个字节。</li>
</ul>
<p>【注意】<code>uboot</code>命令中的<strong>数字都是十六进制的，不是十进制的</strong>！命令里面的数字都是十六进制的，所以可以不用写<code>0x</code>前缀，十进制<br>的 <code>20</code>其十六进制为 <code>0x14</code>，所以命令 <code>md</code>后面的个数应该是 <code>14</code>，如果写成 <code>20</code>的话就表示查看<code>32</code>(十六进制为 <code>0x20</code>)个字节的数据。</p>
<h2 id="2-nm"><a href="#2-nm" class="headerlink" title="2. nm"></a><font size=3>2. <code>nm</code></font></h2><p><code>nm</code>命令用于修改指定地址的内存值，命令格式如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">nm[.b, .w, .l] address</span><br></pre></td></tr></table></figure>

<p><code>nm</code>命令同样可以以 <code>.b</code>、<code> .w</code>和 <code>.l</code>来指定操作格式。例如，我们现在要以<code>.l</code>格式修改<code>0x40008000</code>地址处数据为<code>12345678</code>，我们输入以下命令：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # nm.l 40008000 </span><br><span class="line">40008000: e8bd84f0 ? </span><br></pre></td></tr></table></figure>

<p>其中<code>40008000</code>表示现在要修改的内存地址， <code>e8bd84f0</code>表示地址<code>40008000</code>现在的数据，<code>?</code>后面就可以输入要修改后的数据<code>0x12345678</code>，输入完成以后按下回车:</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">40008000: e8bd84f0 ? 12345678</span><br><span class="line">40008000: 12345678 ? </span><br></pre></td></tr></table></figure>

<p>这样我们便修改了相应的数据，然后输入<code>q</code>再按下回车就可以退出了</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">40008000: 12345678 ? q</span><br></pre></td></tr></table></figure>

<h2 id="3-mm"><a href="#3-mm" class="headerlink" title="3. mm"></a><font size=3>3. <code>mm</code></font></h2><p><code>mm</code>命令也是修改指定地址内存值的，使用 <code>mm</code>修改内存值的时候地址会自增，而使用命令<code>nm</code>的话地址不会自增。使用格式如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mm[.b, .w, .l] address</span><br></pre></td></tr></table></figure>

<p>使用方式与<code>nm</code>一致，只不过它的地址会自己增加，例如</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # mm.l 40008000</span><br><span class="line">40008000: 12345678 ? 11111111</span><br><span class="line">40008004: e92d41f0 ? 22222222</span><br><span class="line">40008008: e1a04000 ? 33333333</span><br><span class="line">4000800c: e1a05001 ? q</span><br><span class="line">fs4412 # nm.l 40008000</span><br><span class="line">40008000: 11111111 ? 44444444</span><br><span class="line">40008000: 44444444 ? 55555555</span><br><span class="line">40008000: 55555555 ? q</span><br></pre></td></tr></table></figure>

<h2 id="4-mw"><a href="#4-mw" class="headerlink" title="4. mw"></a><font size=3>4. <code>mw</code></font></h2><p><code>mw</code>用于使用一个指定的数据填充一段内存，命令格式如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mw[.b, .w, .l] address value [count]</span><br></pre></td></tr></table></figure>

<ul>
<li><code> [.b .w .l]</code>：对应 <code>byte</code>、<code>word</code>和 <code>long</code>，也就是分别以 <code>1</code>个字节 、 <code>2</code>个字节、 <code>4</code>个字节。</li>
<li><code>address</code>：要查看的内存起始地址。</li>
<li><code>value</code>：为要填充的数据。</li>
<li><code>count</code>：填充的长度。</li>
</ul>
<p>例如，</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # mw.l 40008000 12345678 4</span><br><span class="line">fs4412 # md.l 40008000 4</span><br><span class="line">40008000: 12345678 12345678 12345678 12345678    xV4.xV4.xV4.xV4.</span><br></pre></td></tr></table></figure>

<h2 id="5-cp"><a href="#5-cp" class="headerlink" title="5. cp"></a><font size=3>5. <code>cp</code></font></h2><p><code>cp</code>是数据拷贝命令，用于将 <code>DRAM</code>中的数据从一段内存拷贝到另一段内存中，或者把 <code>Nor Flash</code>中的数据拷贝到 <code>DRAM</code>中。命令格式如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cp[.b, .w, .l] source target count</span><br></pre></td></tr></table></figure>

<ul>
<li><code> [.b .w .l]</code>：对应 <code>byte</code>、<code>word</code>和 <code>long</code>，也就是分别以 <code>1</code>个字节 、 <code>2</code>个字节、 <code>4</code>个字节。</li>
<li><code>source</code>：源地址。</li>
<li><code> target</code>：目的地址。</li>
<li><code> count</code>：为拷贝的长度。</li>
</ul>
<p>例如，</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # cp.l 40008000 41000000 5</span><br><span class="line">fs4412 # md.l 41000000 5</span><br><span class="line">41000000: 12345678 12345678 12345678 12345678    xV4.xV4.xV4.xV4.</span><br><span class="line">41000010: e1a07002    .p..</span><br><span class="line">fs4412 # md.l 40008000 5</span><br><span class="line">40008000: 12345678 12345678 12345678 12345678    xV4.xV4.xV4.xV4.</span><br><span class="line">40008010: e1a07002    .p..</span><br></pre></td></tr></table></figure>

<h2 id="6-cmp"><a href="#6-cmp" class="headerlink" title="6. cmp"></a><font size=3>6. <code>cmp</code></font></h2><p><code>cmp</code>是比较命令，用于比较两段内存的数据是否相等，命令格式如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cmp[.b, .w, .l] addr1 addr2 count</span><br></pre></td></tr></table></figure>

<ul>
<li><code> [.b .w .l]</code>：对应 <code>byte</code>、<code>word</code>和 <code>long</code>，也就是分别以 <code>1</code>个字节 、 <code>2</code>个字节、 <code>4</code>个字节。</li>
<li><code>addr1</code>：第一段内存首地址。</li>
<li><code>addr1</code>：第二段内存首地址。</li>
<li><code>count</code>：为要比较的长度。</li>
</ul>
<h1 id="五、存储器访问"><a href="#五、存储器访问" class="headerlink" title="五、存储器访问"></a><font size=3>五、存储器访问</font></h1><p>关于存储器的访问主要是<code>mmc</code>命令，我们使用<code>help mmc</code>来查看它的帮助信息：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">mmc - MMC sub system</span><br><span class="line"></span><br><span class="line">Usage:</span><br><span class="line">mmc read addr blk# cnt</span><br><span class="line">mmc write addr blk# cnt</span><br><span class="line">mmc erase blk# cnt</span><br><span class="line">mmc rescan</span><br><span class="line">mmc part - lists available partition on current mmc device</span><br><span class="line">mmc dev [dev] [part] [bootable]- show or set current mmc device [partition] [bootable]</span><br><span class="line">mmc list - lists available devices</span><br></pre></td></tr></table></figure>

<p>但是还有一个<code>mmcinfo</code>的命令，在目前使用的这个版本<code>uboot</code>中似乎并不被列在<code>mmc</code>的命令中。</p>
<h2 id="1-mmcinfo"><a href="#1-mmcinfo" class="headerlink" title="1. mmcinfo"></a><font size=3>1. <code>mmcinfo</code></font></h2><p><code>mmcinfo</code>命令用于查看当前设备的<code>mmc</code>信息，直接输入命令即可，例如：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # mmcinfo</span><br><span class="line">FAIL: waiting for status update.</span><br><span class="line">Device: S5P_MSHC4</span><br><span class="line">Manufacturer ID: 15</span><br><span class="line">OEM: 100</span><br><span class="line">Name: 8GTF4 </span><br><span class="line">Tran Speed: 0</span><br><span class="line">Rd Block Len: 512</span><br><span class="line">MMC version 4.0</span><br><span class="line">High Capacity: Yes</span><br><span class="line">Capacity: 14.6 MiB</span><br><span class="line">Bus Width: 2-bit</span><br></pre></td></tr></table></figure>

<h2 id="2-mmc-rescan"><a href="#2-mmc-rescan" class="headerlink" title="2. mmc rescan"></a><font size=3>2. <code>mmc rescan</code></font></h2><p><code>mmc rescan</code>命令用于扫描当前开发板上所有的 <code>MMC</code>设备，包括 <code>EMMC</code>和 <code>SD</code>卡，直接输入<code>mmc rescan</code>即可。</p>
<h2 id="3-mmc-list"><a href="#3-mmc-list" class="headerlink" title="3. mmc list"></a><font size=3>3. <code>mmc list</code></font></h2><p><code>mmc list</code>命令用于来查看当前开发板一共有几个<code>MMC</code>设备，直接输入<code>mmc list</code>即可，例如：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # mmc list</span><br><span class="line">S5P_MSHC4_dev0</span><br></pre></td></tr></table></figure>

<h2 id="4-mmc-dev"><a href="#4-mmc-dev" class="headerlink" title="4. mmc dev"></a><font size=3>4. <code>mmc dev</code></font></h2><p><code>mmc dev</code>命令用于切换当前<code>MMC</code>设备，一般使用格式如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mmc dev [dev] [part]</span><br></pre></td></tr></table></figure>

<ul>
<li><code>dev</code>：设置要切换的 <code>MMC</code>设备号。</li>
<li><code>part</code>：分区号，如果不写分区号的话默认为分区 <code>0</code>。</li>
</ul>
<h2 id="5-mmc-part"><a href="#5-mmc-part" class="headerlink" title="5. mmc part"></a><font size=3>5. <code>mmc part</code></font></h2><p>有时候 <code>SD</code>卡或者 <code>EMMC</code>会有多个分区，可以使用命令<code>mmc part</code>来查看其分区，直接输入命令即可：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mmc part</span><br></pre></td></tr></table></figure>

<h2 id="6-mmc-read"><a href="#6-mmc-read" class="headerlink" title="6. mmc read"></a><font size=3>6. <code>mmc read</code></font></h2><p><code>mmc read</code>命令用于将<code>MMC</code>中指定扇区中的内容读取到内存中指定的地址，命令格式如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mmc read &lt;dev_num&gt; addr blk# cnt</span><br></pre></td></tr></table></figure>

<ul>
<li><code>dev_num</code>：<code>mmc</code>的设备号，可以通过<code>mmc list</code>查询到，这个参数可以不写，不写的话默认为当前<code>mmc</code>设备。</li>
<li><code>addr</code>：数据读取到内存中的起始地址。 </li>
<li><code>blk#</code>：要读取的块起始地址 (十六进制 )，一个块是 <code>512</code>字节，这里的块和扇区是一个意思，在 <code>MMC</code>设备中我们通常说扇区。</li>
<li><code> cnt</code>：要读取的块数量 (十六进制 )。</li>
</ul>
<p>例如，</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mmc read 0 0x40008000 0x600 0x10</span><br></pre></td></tr></table></figure>

<p>这个命令的含义就是，把第<code>0</code>个<code>mmc</code>设备块偏移为<code>0x600</code>处开始，长度为<code>16x512</code>大小的数据，读出到内存<code>0x40008000</code>处。</p>
<h2 id="7-mmc-write"><a href="#7-mmc-write" class="headerlink" title="7. mmc write"></a><font size=3>7. <code>mmc write</code></font></h2><p><code>mmc write</code>命令用于将数据写到<code>MMC</code>设备里面。我们可以使用命令<code>mmc write</code>来 升级 <code>uboot</code>，也就是在 <code>uboot</code>中更新 <code>uboot</code>。这里会要用到<code>nfs</code>或者 <code>tftp</code>命令，通过<code>nfs</code>或者<code>tftp</code>命令将新的 <code>u-boot.bin</code>下载到开发板的<code>DRAM</code>中，然后再使用命令<code>mmc write</code>将其写入到<code>MMC</code>设备中。一般使用格式如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mmc write &lt;dev_num&gt; addr blk# cnt</span><br></pre></td></tr></table></figure>

<ul>
<li><code>dev_num</code>：<code>mmc</code>的设备号，可以通过<code>mmc list</code>查询到，这个参数可以不写，不写的话默认为当前<code>mmc</code>设备。</li>
<li><code>addr</code>：数据将要写入到内存中的起始地址。 </li>
<li><code>blk#</code>：要写入的块起始地址 (十六进制 )，一个块是 <code>512</code>字节，这里的块和扇区是一个意思，在 <code>MMC</code>设备中我们通常说扇区。</li>
<li><code> cnt</code>：要写入的块数量 (十六进制 )。</li>
</ul>
<p>【注意】千万不要写 <code>SD</code>卡或者<code>EMMC</code>的前两个块 (扇区 )，里面保存着分区表。</p>
<p>例如，</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mmc write 0 0x40008000 0x600 0x10</span><br></pre></td></tr></table></figure>

<p>这个命令的含义就是，把内存<code>0x40008000</code>开始，长度为<code>16x512</code>大小的数据，写入到第<code>0</code>个<code>mmc</code>设备块偏移位置为<code>0x600</code>处。</p>
<h2 id="8-mmc-erase"><a href="#8-mmc-erase" class="headerlink" title="8. mmc erase"></a><font size=3>8. <code>mmc erase</code></font></h2><p><code>mmc erase</code>命令用于擦除<code>MMC</code>设备的指定块，一般使用格式如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mmc erase blk# cnt</span><br></pre></td></tr></table></figure>

<ul>
<li><code>blk#</code>：要擦除的起始块。</li>
<li><code>cnt</code>：要擦除的数量。</li>
</ul>
<p>【注意】一般不要用 <code>mmc erase</code>来擦除 <code>MMC</code>设备。</p>
<h1 id="六、网络操作"><a href="#六、网络操作" class="headerlink" title="六、网络操作"></a><font size=3>六、网络操作</font></h1><p>在<code>uboot</code>中，至少支持的外设就是串口和网口，因为我们需要通过这两个外设进行文件的传输，下边我们先来学习一下网络操作相关命令吧。</p>
<h2 id="1-网络环境变量"><a href="#1-网络环境变量" class="headerlink" title="1. 网络环境变量"></a><font size=3>1. 网络环境变量</font></h2><p>要使用网络的话，还是需要先设置一下网络的相关环境变量。相关的环境变量如下：</p>
<table>
    <tr><td align="center">环境变量</td><td align="center">描述</td></tr>
    <tr><td align="left">ipaddr</td><td align="left">开发板 IP 地址，可以不设置，使用 dhcp 命令来从路由器获取 IP 地址。</td></tr>
    <tr><td align="left">ethaddr</td><td align="left">开发板的 MAC 地址，一定要设置。</td></tr>
    <tr><td align="left">gatewayip</td><td align="left">网关地址。</td></tr>
    <tr><td align="left">netmask</td><td align="left">子网掩码。</td></tr>
    <tr><td align="left">serverip</td><td align="left">服务器IP地址，也就是 Ubuntu主机 IP 地址，用于调试代码。</td></tr>
</table>


<p>要注意，开发板的<code>IP</code>一定要与<code>Ubuntu</code>主机的<code>IP</code>处于网段，这样才能实现网络通信。我的一般设置如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # setenv ipaddr 192.168.10.102</span><br><span class="line">fs4412 # setenv ethaddr 11:22:33:44:55:66</span><br><span class="line">fs4412 # setenv gatewayip 192.168.10.1 </span><br><span class="line">fs4412 # setenv netmask 255.255.255.0</span><br><span class="line">fs4412 # setenv serverip 192.168.10.101</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">最后再保存一下环境变量到 mmc</span></span><br><span class="line">fs4412 # saveenv</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h2 id="2-ping"><a href="#2-ping" class="headerlink" title="2. ping"></a><font size=3>2. <code>ping</code></font></h2><p>我们的开发板的网络能否使用，是否可以和服务器 (<code>Ubuntu</code>主机 )进行通信，可以通过<code>ping</code>命令验证，直接<code>ping</code>服务器的<code>IP</code>地址即可，比如我的服务器<code>IP</code>地址为 <code>192.168.10.101</code>，那么命令格式如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # ping 192.168.10.101</span><br></pre></td></tr></table></figure>

<p>如果连接成功的话，会有以下信息提示：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">dm9000 i/o: 0x5000000, id: 0x90000a46 </span><br><span class="line">DM9000: running in 16 bit mode</span><br><span class="line">MAC: 11:22:33:44:55:66</span><br><span class="line">operating at 100M full duplex mode</span><br><span class="line">Using dm9000 device</span><br><span class="line">host 192.168.10.101 is alive</span><br></pre></td></tr></table></figure>

<p>如果连接不成功(服务器没开启或者说<code>IP</code>不在同一网段的话)，可能会有以下提示：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">dm9000 i/o: 0x5000000, id: 0x90000a46 </span><br><span class="line">DM9000: running in 16 bit mode</span><br><span class="line">MAC: 11:22:33:44:55:66</span><br><span class="line">operating at 100M full duplex mode</span><br><span class="line">Using dm9000 device</span><br><span class="line">ping failed; host 192.168.10.101 is not alive</span><br></pre></td></tr></table></figure>

<p>【注意】只能在 <code>uboot</code>中 <code>ping</code>其他的机器，其他机器不能 <code>ping uboot</code>，因为 <code>uboot</code>没有对 <code>ping</code>命令做处理，如果用其他的机器 <code>ping uboot</code>的话会失败！</p>
<h2 id="3-dhcp"><a href="#3-dhcp" class="headerlink" title="3. dhcp"></a><font size=3>3. <code>dhcp</code></font></h2><p><code>dhcp</code>用于从路由器获取<code>IP</code>地址，前提得开发板连接到路由器上的，如果开发板是和电脑直连的，那么<code>dhcp</code>命令就会失效。直接输入<code>dhcp</code>命令即可通过路由器获取到<code>IP</code>地址。</p>
<h2 id="4-tftp"><a href="#4-tftp" class="headerlink" title="4. tftp"></a><font size=3>4. <code>tftp</code></font></h2><p><code>tftp</code>命令用于通过网络下载数据到指定的内存地址中，<code>tftp</code>命令使用的是<code>TFTP</code>协议，<code>Ubuntu</code>主机作为<code>TFTP</code>服务器。因此需要在 <code>Ubuntu</code>上搭建<code>TFTP</code>服务器，之前的时候我们已经搭建并本地验证过了，在<code>uboot</code>中使用的格式如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">tftpboot [loadAddress] [[hostIPaddr:]bootfilename]</span><br></pre></td></tr></table></figure>

<ul>
<li><code>tftpboot</code>：命令的全称，但是其实我们输入一个<code>tftp</code>就足够了。</li>
<li><code>loadAddress</code>：是文件在内存中的存放地址。</li>
<li><code>hostIPaddr</code>：服务器的<code>IP</code>地址，实际就是<code>Ubuntu</code>主机的<code>IP</code>地址，如果说前边我们设置了<code>serverip</code>环境变量的话，这里是可以省略的。</li>
<li><code>bootfilename</code>：是要从<code>Ubuntu</code>中下载的文件这个文件是以服务器中<code>tftp</code>目录为根目录的。</li>
</ul>
<p>例如，我们前边设置的<code>tftp</code>目录为<code>/home/hk/3tftp</code>，然后我们需要下载这个文件：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">/home/hk/3tftp/fs4412/interface.bin</span><br></pre></td></tr></table></figure>

<p>这个时候我们使用的命令如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # tftp 40008000 /fs4412/interface.bin</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">或者</span></span><br><span class="line"></span><br><span class="line">fs4412 # tftp 40008000 192.168.10.101:/fs4412/interface.bin</span><br></pre></td></tr></table></figure>

<p>按下<code>enter</code>按键之后，我们会得到以下提示：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">dm9000 i/o: 0x5000000, id: 0x90000a46 </span><br><span class="line">DM9000: running in 16 bit mode</span><br><span class="line">MAC: 11:22:33:44:55:66</span><br><span class="line">operating at 100M full duplex mode</span><br><span class="line">Using dm9000 device</span><br><span class="line">TFTP from server 192.168.10.101; our IP address is 192.168.10.102</span><br><span class="line">Filename &#x27;/fs4412/interface.bin&#x27;.</span><br><span class="line">Load address: 0x40008000</span><br><span class="line">Loading: T #</span><br><span class="line">         0 Bytes/s</span><br><span class="line">done</span><br><span class="line">Bytes transferred = 104 (68 hex)</span><br></pre></td></tr></table></figure>

<p>这个时候我们可以使用<code>go</code>命令运行一下程序，来看看测试程序是否确实下载到了<code>0x40008000</code>处：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">go 40008000</span><br></pre></td></tr></table></figure>

<p>然后我们会看到开发板的<code>led</code>灯开始闪烁，这就说明我们已经成功下载了我们的应用程序到内存中。</p>
<h1 id="七、文件系统操作"><a href="#七、文件系统操作" class="headerlink" title="七、文件系统操作"></a><font size=3>七、文件系统操作</font></h1><h2 id="1-FAT格式文件系统"><a href="#1-FAT格式文件系统" class="headerlink" title="1. FAT格式文件系统"></a><font size=3>1. <code>FAT</code>格式文件系统</font></h2><h3 id="1-1-fatinfo"><a href="#1-1-fatinfo" class="headerlink" title="1.1 fatinfo"></a><font size=3>1.1 <code>fatinfo</code></font></h3><p><code>fatinfo</code>命令用于查询指定<code>MMC</code>设备分区的文件系统信息，格式如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">fatinfo &lt;interface&gt; [&lt;dev[:part]&gt;]</span><br></pre></td></tr></table></figure>

<ul>
<li><code>interface</code>：表示接口，比如<code>mmc</code>。</li>
<li><code>dev</code>：查询的设备号。</li>
<li><code>part</code>：要查询的分区。</li>
</ul>
<p>例如，我们要查询设备<code>0</code>的<code>MMC</code>分区<code>1</code>的文件系统信息，命令如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">fatinfo mmc 0:1</span><br></pre></td></tr></table></figure>

<h3 id="1-2-fatls"><a href="#1-2-fatls" class="headerlink" title="1.2 fatls"></a><font size=3>1.2 <code>fatls</code></font></h3><p><code>fatls</code>命令用于查询<code>FAT</code>格式设备的目录和文件信息，格式如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">fatls &lt;interface&gt; [&lt;dev[:part]&gt;] [directory]</span><br></pre></td></tr></table></figure>

<ul>
<li><code>interface</code>：表示接口，比如<code>mmc</code>。</li>
<li><code>dev</code>：查询的设备号。</li>
<li><code>part</code>：要查询的分区。</li>
<li><code>directory</code>：是要查询的目录。</li>
</ul>
<p>例如，我们要查询设备<code>0</code>的<code>MMC</code>分区<code>1</code>的所有目录和文件，命令如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">fatls mmc 0:1</span><br></pre></td></tr></table></figure>

<h3 id="1-3-fatload"><a href="#1-3-fatload" class="headerlink" title="1.3 fatload"></a><font size=3>1.3 <code>fatload</code></font></h3><p><code>fatload</code>命令用于将指定的文件读取到内存中，命令格式如下：，格式如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">fatload &lt;interface&gt; [&lt;dev[:part]&gt;]  &lt;addr&gt; &lt;filename&gt; [bytes [pos]]</span><br></pre></td></tr></table></figure>

<ul>
<li><code>interface</code>：表示接口，比如<code>mmc</code>。</li>
<li><code>dev</code>：设备号。</li>
<li><code>part</code>：分区。</li>
<li><code>addr</code>：要保存到内存中的起始地址。</li>
<li><code>filename</code>：要读取的文件名字。 </li>
<li><code>bytes</code>：表示读取多少字节的数据，如果<code>bytes</code>为<code>0</code>或者省略的话表示读取整个文件。</li>
<li><code>pos</code>：是要读的文件相对于文件首地址的偏移，如果为<code>0</code>或者省略的话表示从文件首地址开始读取。</li>
</ul>
<p>例如，我们将设备<code>0</code>的分区<code>1</code>中的<code>zImage</code>文件读取到内存中的<code>0X40008000</code>地址处，命令如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">fatload mmc 0:1 40008000 zImage</span><br></pre></td></tr></table></figure>

<h2 id="2-EXT格式文件系统"><a href="#2-EXT格式文件系统" class="headerlink" title="2. EXT格式文件系统"></a><font size=3>2. <code>EXT</code>格式文件系统</font></h2><p>由于这里使用的是<code>uboot 2013</code>版本的，这里的一些命令似乎并不怎么支持，后边用的也很少，这里就不写了，后边用到了再补充。</p>
<h1 id="八、boot操作"><a href="#八、boot操作" class="headerlink" title="八、boot操作"></a><font size=3>八、<code>boot</code>操作</font></h1><h2 id="1-两个环境变量"><a href="#1-两个环境变量" class="headerlink" title="1. 两个环境变量"></a><font size=3>1. 两个环境变量</font></h2><h3 id="1-1-boodcmd"><a href="#1-1-boodcmd" class="headerlink" title="1.1 boodcmd"></a><font size=3>1.1 <code>boodcmd</code></font></h3><p><code>bootcmd</code>环境变量中保存着<code>uboot</code>的默认命令，该环境变量其实也叫做自启动环境变量。在我们重启开发板的时候，会有这么一个提示信息：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Hit any key to stop autoboot : 3</span><br></pre></td></tr></table></figure>

<p>这里就是<code>uboot</code>倒计时，这里的这个时间由环境变量<code>bootdelay</code>控制，当倒计时结束之前按下任意按键，就会进入<code>uboot</code>的一个命令行的模式，着大盖就类似于我们重装<code>windows</code>系统时的<code>BIOS</code>系统一样。</p>
<p>当我们在倒计时期间没有按下任何按键的话，倒计时结束以后就会执行<code>bootcmd</code>中的命令。这些命令一般用来启动<code>linu</code>内核，比如读取<code>EMMC</code>或者<code>NAND Flash</code>中的<code>linux</code>内核镜像文件和设备树文件到<code>DRAM</code>中，然后启动<code>linux</code>内核。可以在 <code>uboot</code> 启动以后进入命令行设置 <code>bootcmd</code> 环境变量的值。如果 <code>EMMC</code> 或者 <code>NAND</code> 中没有保存 <code>bootcmd</code> 的值，那么 <code>uboot</code> 就会使用默认的值，板子第一次运行 <code>uboot</code> 的时候都会使用默认值来设置 <code>bootcmd</code> 环境变量。</p>
<p>需要注意的是该环境变量中可以有多条命令，多条命令之间用<code>\;</code>分隔开，修改完后我们需要将环境变量进行保存，否则下次重启，我们设置的环境变量就会失效，另外，我们可以通过<code>run</code>命令来运行这个环境变量中的命令。例如，</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">fs4412 # setenv bootcmd tftp 40008000 interface.bin\;go 40008000</span><br><span class="line">fs4412 # saveenv</span><br><span class="line">fs4412 # run bootcmd</span><br></pre></td></tr></table></figure>

<h3 id="1-2-bootargs"><a href="#1-2-bootargs" class="headerlink" title="1.2 bootargs"></a><font size=3>1.2 <code>bootargs</code></font></h3><p><code>bootargs</code> 保存着 <code>uboot</code> 传递给 <code>Linux</code> 内核的参数，也被叫做自启动参数，<code>uboot</code>不需要使用。例如，</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">setenv bootargs root=/dev/nfs nfsroot=&lt;server_ip&gt;:&lt;server_nfs_dir_path&gt; rw console=ttySAC2,115200 init=/linuxrc ip=linux_ip</span><br></pre></td></tr></table></figure>

<ul>
<li><code>console</code><br><code>console</code> 用来设置 <code>linux</code> 终端(或者叫控制台)，也就是开发板安装好<code>linux</code>后，我们通过什么设备来和 <code>Linux</code> 进行交互，是串口还是 <code>LCD</code> 屏幕？如果是串口的话串口号是多少等。这里设置 <code>console</code> 为 <code>ttySAC2</code>。<code>ttySAC2</code> 后面有个<code>,115200</code>，这是设置串口的波特率，<code>console=ttySAC2,115200</code> 综合起来就是设置 <code>ttySAC2</code>作为 <code>Linux</code> 的终端，并且串口波特率设置为 <code>115200</code>。</li>
<li><code>root</code><br><code>root</code>用来设置根文件系统的位置，例如</li>
</ul>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">root=/dev/mmcblk[dev_num]p[cnt]</span><br></pre></td></tr></table></figure>

<p>这就表示 <code>mmc</code> 设备 <code>dev_num</code> （从0开始）的分区 <code>cnt</code>（从<code>0</code>开始）。我们有时候也会使用上边例子中的方式：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">root=/dev/nfs nfsroot=&lt;server_ip&gt;:&lt;server_nfs_dir_path&gt;</span><br></pre></td></tr></table></figure>

<p>这指明了根文件系统类型(<code>nfs</code>)，后边的<code>nfsroot</code>表示网络文件系统路径，可以挂载一个<code>ubuntu</code>服务器的<code>nfs</code>共享文件夹。</p>
<p>【注意】在<code>root</code>参数中，还会有一个<code>rw</code>，这就表示根文件系统是可以读写的，不加 <code>rw</code> 的话可能无法在根文件系统中进行写操作，只能进行读操作。</p>
<ul>
<li><code>init</code></li>
</ul>
<p><code>init</code>用来指定<code>init</code>进程的程序路径，一般<code>init=/linuxrc</code>, 或者<code>init=/etc/preinit</code>，<code>preinit</code>的内容一般是创建<code>console</code>、<code>null</code>设备节点，运行<code>init</code>程序，挂载一些文件系统等操作。我们可能以为<code>init=/linuxrc</code>是固定写法，其实不然，<code>/linuxrc</code>指的是<code>/</code>目录下面的<code>linuxrc</code>脚本，一般指向<code>busybox</code>。</p>
<ul>
<li><code>ip</code></li>
</ul>
<p>这就表示<code>linux</code>启动后自身的<code>IP</code>地址。</p>
<h2 id="2-bootm"><a href="#2-bootm" class="headerlink" title="2. bootm"></a><font size=3>2. <code>bootm</code></font></h2><p>要启动<code>Linux</code>，需要先将<code>Linux</code>镜像文件拷贝到<code>DRAM</code>中，如果使用到设备树的话，也需要将设备树拷贝到<code>DRAM</code>中。可以从 <code>EMMC</code>或者<code>NAND</code>等存储设备中将<code>Linux</code>镜像和设备树文件拷贝到<code>DRAM</code>，也可以通过<code>nfs</code>或者<code>tftp</code>将<code>Linux</code>镜像文件和设备树文件下载到<code>DRAM</code>中。<br>不管用那种方法，只要能将<code>Linux</code>镜像和设备树文件存到<code>DRAM</code>中就行，然后使用<code>boom</code>命令来启动，<code>boom</code>命令用于启动<code>linux</code>镜像文件， <code>boom</code>命令格式如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">bootm [addr [arg ...]]</span><br></pre></td></tr></table></figure>

<ul>
<li><code>addr</code>是<code>linux</code>镜像在<code>DRAM</code>中的首地址。</li>
<li><code>arg</code>：可以是一个<code>initrd</code>映像的地址，当引导一个需要设备树的<code>Linux</code>内核时，需要第三个参数，它是设备树的地址。要在不使用<code>initrd</code>镜像的情况下引导内核，我们需要使用<code>-</code>作为第二个参数。</li>
</ul>
<p>其实有的资料中，该命令格式是这样的，我感觉更加详细一点：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">bootm [addr [initrd[:size]] [fdt]]</span><br></pre></td></tr></table></figure>

<ul>
<li><code>addr</code>：是 <code>Linux</code>镜像文件在<code>DRAM</code>中的位置，</li>
<li><code>initrd</code>：是 <code>initrd</code>文件在<code>DRAM</code>中的地址，如果不使用 <code>initrd</code>的话使用<code>-</code>代替即可 。</li>
<li><code>fdt</code>：就是设备树文件在 <code>DRAM</code> 中的地址。</li>
</ul>
<p>或者直接这样写可能更清晰一点：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">bootm kernel-addr ramdisk-addr dtb-addr</span><br></pre></td></tr></table></figure>

<ul>
<li><code>kernel-addr</code>: 内核的下载地址 。</li>
<li><code>ramdisk-addr</code>: 根文件系统的下载地址。</li>
<li><code>dtb-addr</code>: 设备树的下载地址。</li>
</ul>
<p>【注意】若不使用相应的地址，对应的位置写<code>-</code>。</p>

    </div>

    
    
    

    <footer class="post-footer">




    <div>
        
            <div style="text-align:center;color: #ccc;font-size:14px;">
            ----------本文结束
            <i class="fas fa-fan fa-spin" style="color: #FF1493; font-size: 1rem"></i>
            感谢您的阅读----------
            </div>
        
    </div>





  
  <div class="my_post_copyright"> 
    <p><span>文章标题:</span><a href="/post/41a25a19.html">LV09-02-uboot-02-命令简介</a></p>
    <p><span>文章作者:</span><a href="/" title="欢迎访问 《苏木》 的学习笔记">苏木</a></p>
    <p><span>发布时间:</span>2023年07月07日 - 19:34</p>
    <p><span>最后更新:</span>2025年06月14日 - 00:25</p>
    <p><span>原始链接:</span><a href="/post/41a25a19.html" title="LV09-02-uboot-02-命令简介">https://sumumm.github.io/post/41a25a19.html</a></p>
    <p><span>许可协议:</span><i class="fab fa-creative-commons"></i> <a rel="license" href= "https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank" title="Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)">署名-非商业性使用-禁止演绎 4.0 国际</a> 转载请保留原文链接及作者。</p>  
  </div>
  


          <div class="post-tags">
              <a href="/tags/LV09-uboot%E4%B8%8Elinux/" rel="tag"><i class="fa fa-tag"></i> LV09-uboot与linux</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/post/9d24e334.html" rel="prev" title="LV09-02-uboot-03-uboot移植">
                  <i class="fa fa-angle-left"></i> LV09-02-uboot-03-uboot移植
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/post/33f62c26.html" rel="next" title="LV09-02-uboot-01-烧写与加载">
                  LV09-02-uboot-01-烧写与加载 <i class="fa fa-angle-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">

  <div class="copyright">
    &copy; 2017 – 
    <span itemprop="copyrightYear">2025</span>
    <span class="with-love">
      <i class="fa fa-heart"></i>
    </span>
    <span class="author" itemprop="copyrightHolder">苏木</span>
  </div>
<div class="wordcount">
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-line"></i>
    </span>
      <span>站点总字数：</span>
    <span title="站点总字数">3.7m</span>
  </span>
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span>站点阅读时长 &asymp;</span>
    <span title="站点阅读时长">225:26</span>
  </span>
</div>




    <span id="sitetime"></span>
    <script defer language=javascript>
        function siteTime()
        {
            window.setTimeout("siteTime()", 1000);
            var seconds = 1000;
            var minutes = seconds * 60;
            var hours = minutes * 60;
            var days = hours * 24;
            var years = days * 365;
            var today = new Date();
            var todayYear = today.getFullYear();
            var todayMonth = today.getMonth()+1;
            var todayDate = today.getDate();
            var todayHour = today.getHours();
            var todayMinute = today.getMinutes();
            var todaySecond = today.getSeconds();
            /*==================================================
            Date.UTC() -- 返回date对象距世界标准时间(UTC)1970年1月1日午夜之间的毫秒数(时间戳)
            year        - 作为date对象的年份，为4位年份值
            month       - 0-11之间的整数，做为date对象的月份
            day         - 1-31之间的整数，做为date对象的天数
            hours       - 0(午夜24点)-23之间的整数，做为date对象的小时数
            minutes     - 0-59之间的整数，做为date对象的分钟数
            seconds     - 0-59之间的整数，做为date对象的秒数
            microseconds - 0-999之间的整数，做为date对象的毫秒数
            ==================================================*/
            var t1 = Date.UTC(2017, 
                              5, 
                              19, 
                              0, 
                              0, 
                              0); //北京时间
            var t2 = Date.UTC(todayYear,todayMonth,todayDate,todayHour,todayMinute,todaySecond);
            var diff = t2-t1;
            var diffYears = Math.floor(diff/years);
            var diffDays = Math.floor((diff/days)-diffYears*365);
            var diffHours = Math.floor((diff-(diffYears*365+diffDays)*days)/hours);
            var diffMinutes = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours)/minutes);
            var diffSeconds = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours-diffMinutes*minutes)/seconds);
            document.getElementById("sitetime").innerHTML="已在这里 "+diffYears+" 年 "+diffDays+" 天 "+diffHours+" 小时 "+diffMinutes+" 分钟 "+diffSeconds+" 秒";
        }
        siteTime();
    </script>



    </div>
  </footer>

  
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up fa-lg"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/next-theme-pjax/0.6.0/pjax.min.js" integrity="sha256-vxLn1tSKWD4dqbMRyv940UYw4sXgMtYcK6reefzZrao=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.28/fancybox/fancybox.umd.js" integrity="sha256-ytMJGN3toR+a84u7g7NuHm91VIR06Q41kMWDr2pq7Zo=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/lozad.js/1.16.0/lozad.min.js" integrity="sha256-mOFREFhqmHeQbXpK2lp4nA3qooVgACfh88fpJftLBbc=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script><script src="/js/pjax.js"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/hexo-generator-searchdb/1.4.1/search.js" integrity="sha256-1kfA5uHPf65M5cphT2dvymhkuyHPQp5A53EGZOnOLmc=" crossorigin="anonymous"></script>
<script src="/js/third-party/search/local-search.js"></script>




  <script src="/js/third-party/fancybox.js"></script>

  <script src="/js/third-party/pace.js"></script>


  




  

  <script class="next-config" data-name="enableMath" type="application/json">true</script><script class="next-config" data-name="mathjax" type="application/json">{"enable":true,"tags":"none","js":{"url":"https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.js","integrity":"sha256-MASABpB4tYktI2Oitl4t+78w/lyA+D7b/s9GEP0JOGI="}}</script>
<script src="/js/third-party/math/mathjax.js"></script>


 
        <div id="click-show-text"
            data-mobile = false
            data-text = 富强,民主,文明,和谐,自由,平等,公正,法制,爱国,敬业,诚信,友善
            data-fontsize = 15px
            data-random= false>
        </div>
       

      
        <script async src=https://cdn.jsdelivr.net/npm/hexo-next-mouse-effect@latest/click/showText.js></script>
      

      
    




    <script async src="/js/fancybox_param.js"></script>





<!-- APlayer本体 -->



</body>
</html>
